<!DOCTYPE html>
<html class="x-admin-sm">
<!--添加管理员页面-->
<head>
    <meta charset="UTF-8">
    <title>气清</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script type="text/javascript" src="./js/cookie.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
<div class="x-body">
    <form class="layui-form">
        <div class="layui-form-item ">
            <label for="username" class="layui-form-label">
                <span class="x-red">*</span>申请人
            </label>
            <div class="layui-input-inline">
                <input id="username" name="username" required="" lay-verify="username"
                       autocomplete="off" class="layui-input" readonly="readonly">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="leaveType" class="layui-form-label">
                <span class="x-red">*</span>请假类型
            </label>
            <div class="layui-input-inline">
                <input id="leaveType" name="username" required="" lay-verify="leaveType"
                       autocomplete="off" class="layui-input" readonly="readonly">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item ">
            <label for="start" class="layui-form-label">
                <span class="x-red">*</span>开始时间
            </label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="start" id="start" placeholder="yyyy-MM-dd"
                       lay-verify="startTime" autocomplete="off" readonly="readonly">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item ">
            <label for="end" class="layui-form-label">
                <span class="x-red">*</span>结束时间
            </label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="end" id="end" placeholder="yyyy-MM-dd" lay-verify="endTime"
                       autocomplete="off" readonly="readonly">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item ">
            <label for="reason" class="layui-form-label">
                <span class="x-red">*</span>请假原因
            </label>
            <div class="layui-input-inline">
                <textarea placeholder="请输入内容" class="layui-textarea" id="reason" name="reason" required=""
                          lay-verify="reason" disabled></textarea>
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
    </form>
</div>
<script>
    var replyid;
    //回显数据
    init();

    function init() {
        var url = window.location.href;
        var id = url.split('?id=')[1];
        replyid = id;
        $.ajax({
            async: false,
            url: '/reply-list/show',
            data: {"id": id},
            dataType: 'json',
            success: function (result) {
                console.log(result);
                var reply = result.data;
                $('#username').val(reply.username);
                $('#reason').val(reply.reason);
                $('#start').val(reply.start);
                $('#end').val(reply.end);
                $('#leaveType').val(reply.leaveType);
            }
        });
    }

    layui.use(['form', 'layer', 'laydate'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;
        var laydate = layui.laydate;





    });
</script>

</body>

</html>